<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class c_login extends CI_Controller {

	function __construct(){
		parent::__construct();
		$this->load->model('m_login');
		checkLogin();
	}
	
	function index(){
		$data['content'] = $this->load->view('v_login',null,true);
		$this->load->view('v_main_login',$data);
	}
	
	function process(){
		$username = secure_post('l_username');
		$password = secure_post('l_password');
		
		$data = $this->m_login->login_process($username,$password);
		echo json_encode($data);
	}
	
	function logout(){
		// echo $this->session->userdata('administrator');
		setLogout();
	}

}